<?php 
	class Week2Model{
		private static $instance = null;
		private static $db = null;

		private function __construct(){
			if (self::$db = null) {
				self::$db = new PDO("mysql:host=localhost;dbname=php9",'root','root');
			}
			return self::$db;
		}

		public static function getInstance(){
			if (!self::$instance instanceof Week2Model) {
				self::$instance = new Week2Model();
			}
			return self::$instance;
		}

		public function getList(){
			$sql="select * from user";
			$res=self::$db->query($sql);
			return $res->fetchAll();
		}
	}

 ?>